﻿CREATE TABLE [dbo].[CiTableColumns] (
    [Id]              INT            IDENTITY (1, 1) NOT NULL,
    [TableCode]       NVARCHAR (200) NULL,
    [TableName]       NVARCHAR (50)  NULL,
    [ColumnCode]      NVARCHAR (200) NULL,
    [ColumnName]      NVARCHAR (50)  NULL,
    [IsPublic]        INT            CONSTRAINT [DF__CiTableCo__IsPub__31B762FC] DEFAULT ((0)) NOT NULL,
    [ColumnAccess]    INT            CONSTRAINT [DF__CiTableCo__Colum__32AB8735] DEFAULT ((0)) NOT NULL,
    [ColumnEdit]      INT            CONSTRAINT [DF__CiTableCo__Colum__339FAB6E] DEFAULT ((0)) NOT NULL,
    [ColumnDeney]     INT            CONSTRAINT [DF__CiTableCo__Colum__3493CFA7] DEFAULT ((0)) NOT NULL,
    [UseConstraint]   INT            CONSTRAINT [DF_CiTableColumns_UseConstraint] DEFAULT ((0)) NOT NULL,
    [DataType]        NVARCHAR (50)  NULL,
    [TargetTable]     NVARCHAR (50)  NULL,
    [IsSearchColumn]  INT            CONSTRAINT [DF_CiTableColumns_IsSearchColumn] DEFAULT ((0)) NOT NULL,
    [IsExhibitColumn] INT            CONSTRAINT [DF_CiTableColumns_IsExhibitColumn] DEFAULT ((0)) NOT NULL,
    [Enabled]         INT            CONSTRAINT [DF__CiTableCo__Enabl__3587F3E0] DEFAULT ((1)) NOT NULL,
    [AllowEdit]       INT            CONSTRAINT [DF__CiTableCo__Allow__367C1819] DEFAULT ((1)) NOT NULL,
    [AllowDelete]     INT            CONSTRAINT [DF__CiTableCo__Allow__37703C52] DEFAULT ((1)) NOT NULL,
    [DeleteMark]      INT            CONSTRAINT [DF__CiTableCo__Delet__3864608B] DEFAULT ((0)) NOT NULL,
    [SortCode]        INT            NULL,
    [Description]     NVARCHAR (800) NULL,
    [CreateOn]        DATETIME       CONSTRAINT [DF__CiTableCo__Creat__395884C4] DEFAULT (getdate()) NOT NULL,
    [CreateUserId]    NVARCHAR (50)  NULL,
    [CreateBy]        NVARCHAR (50)  NULL,
    [ModifiedOn]      DATETIME       NULL,
    [ModifyUserId]    NVARCHAR (50)  NULL,
    [ModifiedBy]      NVARCHAR (50)  NULL,
    CONSTRAINT [PK_CITABLECOLUMNS] PRIMARY KEY NONCLUSTERED ([Id] ASC)
);

